package com.kaluli.project.repository.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.kaluli.project.domain.entity.KllRefundDetail;
import com.kaluli.project.domain.repository.KllRefundDetailRepository;
import com.kaluli.system.repository.AbstractRepositorySupport;

@Repository
public class KllRefundDetailRepositoryImpl extends AbstractRepositorySupport<KllRefundDetail>
		implements KllRefundDetailRepository {


	@Override
	protected Class<KllRefundDetail> getEntityClass() {
		// TODO 自动生成的方法存根
		return KllRefundDetail.class;
	}
	
	
	public KllRefundDetail findRefundDetail(String orderNumber) {
		StringBuffer hql = new StringBuffer(" from KllRefundDetail t where t.orderNumber=:order_number");
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("order_number", orderNumber);
		List<KllRefundDetail> list = this.findHqlForMap(hql.toString(), params);
		KllRefundDetail refund = null;
		if (list != null & list.size() > 0) {
			refund = list.get(0);
		}
		return refund;
	}

}
